.herb-detail {
  padding: 15px;
  overflow-y: auto;
  max-height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.herb-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  gap: 15px;
}

.herb-name {
  color: var(--primary-color);
  font-size: 1.4rem;
  text-align: left;
  font-family: 'SimSun', 'STSong', serif;
  letter-spacing: 1px;
  word-wrap: break-word;
  flex: 1;
  margin: 0;
}

.detail-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
}

.herb-info {
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.herb-model {
  width: 120px;
  height: 120px;
  min-width: 120px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  background-color: #f9f9f9;
  flex-shrink: 0;
}

.detail-section {
  margin-bottom: 12px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  padding: 12px;
}

.detail-section h3 {
  color: var(--secondary-color);
  font-size: 1rem;
  margin-bottom: 6px;
  border-left: 3px solid var(--accent-color);
  padding-left: 8px;
  letter-spacing: 1px;
}

.category {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.category span {
  color: var(--primary-color);
  font-weight: bold;
}

.properties {
  display: flex;
  gap: 15px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.property {
  display: flex;
  gap: 5px;
  align-items: center;
  background-color: rgba(143, 87, 51, 0.08);
  padding: 3px 8px;
  border-radius: 4px;
}

.property label {
  font-weight: bold;
  color: var(--text-secondary);
}

.functions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.function-tag {
  background-color: var(--accent-color);
  color: var(--primary-color);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.description {
  line-height: 1.5;
  text-align: justify;
  font-size: 0.95rem;
  color: var(--text-color);
}

.pairs {
  padding-left: 15px;
  line-height: 1.5;
  margin: 0;
}

.pairs li {
  margin-bottom: 4px;
  font-size: 0.95rem;
}

/* 相关药材样式 */
.related-herbs-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  width: 100%;
}

.related-herb-item {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: var(--card-bg);
  overflow: hidden;
  position: relative;
}

.related-herb-item:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  border-color: var(--primary-color);
}

.related-herb-info {
  display: flex;
  flex-direction: column;
  padding-right: 20px;
}

.related-herb-info h4 {
  margin: 0 0 3px 0;
  color: var(--primary-color);
  font-size: 0.95rem;
}

.related-herb-category {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0;
}

.relation-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.relation-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  color: white;
  font-size: 0.85rem;
  margin-right: 5px;
}

.relation-strength {
  display: flex;
  align-items: center;
  gap: 10px;
}

.strength-bar {
  flex: 1;
  height: 8px;
  background-color: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  background-color: var(--success-color);
  border-radius: 4px;
}

.strength-label {
  font-size: 0.9rem;
  color: #666;
  min-width: 40px;
  text-align: right;
}

.relation-description {
  font-size: 0.9rem;
  color: #666;
}

.relation-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  color: white;
  display: inline-block;
}

/* 响应式样式 */
@media (max-width: 1200px) {
  .herb-model {
    width: 100px;
    height: 100px;
    min-width: 100px;
  }
  
  .herb-name {
    font-size: 1.3rem;
  }
  
  .related-herbs-list {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 768px) {
  .herb-header {
    flex-direction: row;
    align-items: center;
  }
  
  .herb-model {
    width: 80px;
    height: 80px;
    min-width: 80px;
  }
  
  .herb-name {
    font-size: 1.2rem;
  }
  
  .info-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .related-herbs-list {
    grid-template-columns: repeat(2, 1fr);
    max-height: 300px;
  }
  
  .detail-section {
    padding: 10px;
  }
}

@media (max-width: 576px) {
  .herb-header {
    flex-direction: row-reverse;
    justify-content: space-between;
  }
  
  .herb-name {
    font-size: 1.1rem;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .related-herbs-list {
    grid-template-columns: 1fr;
    max-height: 350px;
  }
  
  .herb-detail {
    padding: 10px;
  }
  
  .function-tag {
    padding: 3px 8px;
    font-size: 0.8rem;
  }
}

.loading-herb {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 200px;
  gap: 15px;
  color: var(--text-secondary);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.info-item {
  display: flex;
  flex-direction: column;
  padding: 5px 8px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 4px;
}

.info-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.info-value {
  font-weight: 500;
  color: var(--primary-color);
  font-size: 0.95rem;
}

.herb-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
  padding: 0 5px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.close-btn:hover {
  background-color: var(--bg-color);
  color: var(--primary-color);
} 